package com.woniu.service.impl;

import com.sun.org.apache.regexp.internal.RE;
import com.woniu.dao.PpayMapper;
import com.woniu.dao.ServiceOrderMapper;
import com.woniu.dao.ServiceOrderdtoMapper;
import com.woniu.dao.PpayMapper;
import com.woniu.pojo.Ppay;
import com.woniu.pojo.ServiceOrder;
import com.woniu.pojo.ServiceOrderdto;
import com.woniu.service.ServiceOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ServiceOrderServiceimpl implements ServiceOrderService {

    @Autowired
    private ServiceOrderMapper serviceOrderMapper;

    @Autowired
    private ServiceOrderdtoMapper serviceOrderdtoMapper;

    @Autowired
    private PpayMapper ppayMapper;

    @Override
    public ServiceOrderdto selectByid(Integer id) {
        return serviceOrderdtoMapper.selectServiceOrderdtoById(id);
    }

    @Override
    public Ppay selectbyid(Integer id) {
        return ppayMapper.selectByPrimaryKey(id);
    }

    @Override
    public Integer  addServiceOrder(ServiceOrder serviceOrder) {
      return serviceOrderMapper.insertSelective(serviceOrder);
    }

    @Override
    public Integer addPpay(Ppay ppay) {
        return ppayMapper.insertSelective(ppay);
    }

    @Override
    public ServiceOrder selectServiceorderByid(Integer id) {
        return serviceOrderMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<ServiceOrderdto> selectspoke(Integer userid) {
        return  serviceOrderdtoMapper.selectspokeByuserid(userid);
    }

    @Override
    public List<ServiceOrderdto> selectattend(Integer userid) {
        return serviceOrderdtoMapper.selectattendByuserId(userid);
    }

    @Override
    public List<ServiceOrderdto> selectreturn(Integer userid) {
        return serviceOrderdtoMapper.selectreturnByuserId(userid);
    }

    @Override
    public List<ServiceOrderdto> selectwait(Integer userid) {
        return serviceOrderdtoMapper.selectwaitByuserId(userid);
    }

    @Override
    public List<ServiceOrderdto> selectwaitpay(Integer userid) {
        return serviceOrderdtoMapper.selectwaitpayByuserId(userid);
    }

    @Override
    public List<ServiceOrderdto> selectstate(Integer userid) {
        return serviceOrderdtoMapper.selectstateByuserId(userid);
    }

    @Override
    public List<ServiceOrderdto> selectrefuse(Integer userid) {
        return serviceOrderdtoMapper.selectrefuseByuserId(userid);
    }

    @Override
    public List<ServiceOrderdto> selectcomplete(Integer userid) {
       return serviceOrderdtoMapper.selectcompletByuserId(userid);
    }


}
